#include "ItemProcessorBank.h"
#include "Config.h"
#include "StarItemProcessor.h"
#include "ShieldProcessor.h"
#include "PowerUp5Processor.h"
#include "PowerMaxProcessor.h"
#include "MagnetProcessor.h"
#include "SpeedRunProcessor.h"


ItemProcessorBank::ItemProcessorBank(void)
{
}


ItemProcessorBank::~ItemProcessorBank(void)
{
}

ItemProcessorBank* ItemProcessorBank::sharedItemProcessorBank()
{
	if (!_instance)
		_instance = new ItemProcessorBank();
	return _instance;
}

void ItemProcessorBank::initBank()
{

}

void ItemProcessorBank::clearBank()
{
	delete _instance;
	_instance = NULL;
}

ItemProcessor* ItemProcessorBank::getProcessor( const char* type )
{
	ItemProcessor* process = NULL;

	if (strcmp(ITEMPROCESSOR_STAR, type) == 0)
		process = StarItemProcessor::create();
	else if (strcmp(ITEMPROCESSOR_SHIELD, type) == 0)
		process = ShieldProcessor::create();
	else if (strcmp(ITEMPROCESSOR_POWER5, type) == 0)
		process = PowerUp5Processor::create();
	else if (strcmp(ITEMPROCESSOR_POWERMAX, type) == 0)
		process = PowerMaxProcessor::create();
	else if (strcmp(ITEMPROCESSOR_MAGNET, type) == 0)
		process = MagnetProcessor::create();
	else if (strcmp(ITEMPROCESSOR_SPEEDRUN, type) == 0)
		process = SpeedRunProcessor::create();
	return process;
}

ItemProcessorBank* ItemProcessorBank::_instance = NULL;
